<?php

namespace Gwit\PlateformBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * Gwit\PlateformBundle\Entity\Monitor
 * 
 */
class Monitor
{
    /**
     * @var integer $id
     */
    private $id;

    /**
     * @var string $name
     */
    private $name;

    /**
     * @var integer $user_id
     */
    private $user_id;

    /**
     * @var float $position
     */
    private $position;

    /**
     * @var date $dateCreated
     */
    private $dateCreated;

    /**
     * @var date $dateUpdated
     */
    private $dateUpdated;
    
    /**
     *
     * @var type 
     */
    private $comment;

    /**
     * @var integer $favorite
     */
    private $favorite;
    
    /**
     *
     * @var booleanb $ontop 
     */
    private $ontop;

    
    /**
     * Constructor
     * Constructeur initialise les dates 
     */
    public function __construct(){
        $this->dateCreated = new \Datetime();
        $this->dateUpdated = new \Datetime();
        $this->ontop = false;
    }
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set user_id
     *
     * @param integer $userId
     */
    public function setUserId($userId)
    {
        $this->user_id = $userId;
    }

    /**
     * Get user_id
     *
     * @return integer 
     */
    public function getUserId()
    {
        return $this->user_id;
    }

    /**
     * Set position
     *
     * @param float $position
     */
    public function setPosition($position)
    {
        $this->position = $position;
    }

    /**
     * Get position
     *
     * @return float 
     */
    public function getPosition()
    {
        return $this->position;
    }

    /**
     * Set dateCreated
     *
     * @param date $dateCreated
     */
    public function setDateCreated($dateCreated)
    {
        $this->dateCreated = $dateCreated;
    }

    /**
     * Get dateCreated
     *
     * @return date 
     */
    public function getDateCreated()
    {
        return $this->dateCreated;
    }

    /**
     * Set dateUpdated
     *
     * @param date $dateUpdated
     */
    public function setDateUpdated($dateUpdated)
    {
        $this->dateUpdated = $dateUpdated;
    }

    /**
     * Get dateUpdated
     *
     * @return date 
     */
    public function getDateUpdated()
    {
        return $this->dateUpdated;
    }

    /**
     * Set favorite
     *
     * @param integer $favorite
     */
    public function setFavorite($favorite)
    {
        $this->favorite = $favorite;
    }
    
    public function getOntop(){
        return $this->ontop;
    }
    
    public function setOntop($ontop){
        $this->ontop = $ontop;
    }

    /**
     * Get favorite
     *
     * @return integer 
     */
    public function getFavorite()
    {
        return $this->favorite;
    }
    
    public function getComment(){
        return $this->comment;
    }
    
    public function setComment($comment){
        $this->comment = $comment;
    }
    
    public function JsonSerialize() {
        return array('name'=>$this->name, 'position'=>$this->position, 'favorite'=>$this->favorite);
    }
    
    public function __toString(){
        return "Moniteur :".$this->id." Name : ".$this->name;
    }
}